import numpy as np
from collections import defaultdict
valid_rules = defaultdict(int)
invalid_rules = defaultdict(int)
num_occurances = defaultdict(int)
rule_valid = 0
rule_invalid = 0
file_name = 'affinity_dataset.txt'
X = np.loadtxt(file_name)
n_samples, n_features = X.shape
features = ["bread", "milk", "cheese", "apples", "bananas"]

num_apple_purchase = 0
for sample in X:
    for premise in range(4):
        if sample[premise] == 0: continue
print("{} people bought apples".format(num_apple_purchase))